extends layout

block content
  include includes/navbar.pug
  h1.text-center Picture Share 
  .container-fluid
    .row
      .row.col-12.col-md-9
        .row.col-12
            .card.col-12
              .card-body
                form(action="/images/", method="post", enctype="multipart/form-data")
                  .form-group.row
                    label.col-12.col-md-2 View 
                    input.col-12.col-md-10.form-control-file(type='file',name='imgfile')
                  .form-group.row
                    label.col-12.col-md-2 Title 
                    input.col-12.col-md-10.form-control(type='text', name='title')
                  .form-group.row
                    label.col-12.col-md-2 Description 
                    input.col-12.col-md-10.form-control(type='text', name='description')
                  .form-group.row
                    .col-12.offset-md-8.col-md-4
                      button.btn.btn-primary.btn-block(type='submit') Submit
        .row.col-12
            .card-columns
              each image in images
                .card
                  a(href=`/images/${image.id}`)
                    img.card-img-top(src=`/uploads/${image.diskfilename}`, alt=image.title)
                  .card-body
                    h5.card-title= image.title
                    p.card-text= image.description
      
      .row.col-12.col-md-3
        include  includes/stats.pug
        .list-group.col-12
          .list-group-item.active
            h6.list-group-item-heading Least comments
          each com in leastCom
            a.list-group-item
              h6.list-group-item-heading= com.nickname
              p.list-group-item-text= com.comment